3.1.11 \(\int \sec ^7(c+d x) (a+i a \tan (c+d x)) \, dx\) [11]

3.1.11.1 Optimal result
3.1.11.2 Mathematica [A] (verified)
3.1.11.3 Rubi [A] (verified)
3.1.11.4 Maple [A] (verified)
3.1.11.5 Fricas [B] (verification not implemented)
3.1.11.6 Sympy [F]
3.1.11.7 Maxima [A] (verification not implemented)
3.1.11.8 Giac [B] (verification not implemented)
3.1.11.9 Mupad [B] (verification not implemented)

3.1.11.1 Optimal result

Integrand size = 22, antiderivative size = 98 \[ \int \sec ^7(c+d x) (a+i a \tan (c+d x)) \, dx=\frac {5 a \text {arctanh}(\sin (c+d x))}{16 d}+\frac {i a \sec ^7(c+d x)}{7 d}+\frac {5 a \sec (c+d x) \tan (c+d x)}{16 d}+\frac {5 a \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {a \sec ^5(c+d x) \tan (c+d x)}{6 d} \]

output
5/16*a*arctanh(sin(d*x+c))/d+1/7*I*a*sec(d*x+c)^7/d+5/16*a*sec(d*x+c)*tan( 
d*x+c)/d+5/24*a*sec(d*x+c)^3*tan(d*x+c)/d+1/6*a*sec(d*x+c)^5*tan(d*x+c)/d
 
3.1.11.2 Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.00 \[ \int \sec ^7(c+d x) (a+i a \tan (c+d x)) \, dx=\frac {5 a \text {arctanh}(\sin (c+d x))}{16 d}+\frac {i a \sec ^7(c+d x)}{7 d}+\frac {5 a \sec (c+d x) \tan (c+d x)}{16 d}+\frac {5 a \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {a \sec ^5(c+d x) \tan (c+d x)}{6 d} \]

input
Integrate[Sec[c + d*x]^7*(a + I*a*Tan[c + d*x]),x]
 
output
(5*a*ArcTanh[Sin[c + d*x]])/(16*d) + ((I/7)*a*Sec[c + d*x]^7)/d + (5*a*Sec 
[c + d*x]*Tan[c + d*x])/(16*d) + (5*a*Sec[c + d*x]^3*Tan[c + d*x])/(24*d) 
+ (a*Sec[c + d*x]^5*Tan[c + d*x])/(6*d)
 
3.1.11.3 Rubi [A] (verified)

Time = 0.53 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.09, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.455, Rules used = {3042, 3967, 3042, 4255, 3042, 4255, 3042, 4255, 3042, 4257}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec ^7(c+d x) (a+i a \tan (c+d x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sec (c+d x)^7 (a+i a \tan (c+d x))dx\)

\(\Big \downarrow \) 3967

\(\displaystyle a \int \sec ^7(c+d x)dx+\frac {i a \sec ^7(c+d x)}{7 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle a \int \csc \left (c+d x+\frac {\pi }{2}\right )^7dx+\frac {i a \sec ^7(c+d x)}{7 d}\)

\(\Big \downarrow \) 4255

\(\displaystyle a \left (\frac {5}{6} \int \sec ^5(c+d x)dx+\frac {\tan (c+d x) \sec ^5(c+d x)}{6 d}\right )+\frac {i a \sec ^7(c+d x)}{7 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle a \left (\frac {5}{6} \int \csc \left (c+d x+\frac {\pi }{2}\right )^5dx+\frac {\tan (c+d x) \sec ^5(c+d x)}{6 d}\right )+\frac {i a \sec ^7(c+d x)}{7 d}\)

\(\Big \downarrow \) 4255

\(\displaystyle a \left (\frac {5}{6} \left (\frac {3}{4} \int \sec ^3(c+d x)dx+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 d}\right )+\frac {\tan (c+d x) \sec ^5(c+d x)}{6 d}\right )+\frac {i a \sec ^7(c+d x)}{7 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle a \left (\frac {5}{6} \left (\frac {3}{4} \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 d}\right )+\frac {\tan (c+d x) \sec ^5(c+d x)}{6 d}\right )+\frac {i a \sec ^7(c+d x)}{7 d}\)

\(\Big \downarrow \) 4255

\(\displaystyle a \left (\frac {5}{6} \left (\frac {3}{4} \left (\frac {1}{2} \int \sec (c+d x)dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 d}\right )+\frac {\tan (c+d x) \sec ^5(c+d x)}{6 d}\right )+\frac {i a \sec ^7(c+d x)}{7 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle a \left (\frac {5}{6} \left (\frac {3}{4} \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 d}\right )+\frac {\tan (c+d x) \sec ^5(c+d x)}{6 d}\right )+\frac {i a \sec ^7(c+d x)}{7 d}\)

\(\Big \downarrow \) 4257

\(\displaystyle a \left (\frac {5}{6} \left (\frac {3}{4} \left (\frac {\text {arctanh}(\sin (c+d x))}{2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 d}\right )+\frac {\tan (c+d x) \sec ^5(c+d x)}{6 d}\right )+\frac {i a \sec ^7(c+d x)}{7 d}\)

input
Int[Sec[c + d*x]^7*(a + I*a*Tan[c + d*x]),x]
 
output
((I/7)*a*Sec[c + d*x]^7)/d + a*((Sec[c + d*x]^5*Tan[c + d*x])/(6*d) + (5*( 
(Sec[c + d*x]^3*Tan[c + d*x])/(4*d) + (3*(ArcTanh[Sin[c + d*x]]/(2*d) + (S 
ec[c + d*x]*Tan[c + d*x])/(2*d)))/4))/6)
 

3.1.11.3.1 Defintions of rubi rules used

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3967
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[b*((d*Sec[e + f*x])^m/(f*m)), x] + Simp[a   Int[(d 
*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2*m] 
|| NeQ[a^2 + b^2, 0])
 

rule 4255
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) 
  Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] 
&& IntegerQ[2*n]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
3.1.11.4 Maple [A] (verified)

Time = 36.22 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.76

method result size
derivativedivides \(\frac {\frac {i a}{7 \cos \left (d x +c \right )^{7}}+a \left (-\left (-\frac {\left (\sec ^{5}\left (d x +c \right )\right )}{6}-\frac {5 \left (\sec ^{3}\left (d x +c \right )\right )}{24}-\frac {5 \sec \left (d x +c \right )}{16}\right ) \tan \left (d x +c \right )+\frac {5 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(74\)
default \(\frac {\frac {i a}{7 \cos \left (d x +c \right )^{7}}+a \left (-\left (-\frac {\left (\sec ^{5}\left (d x +c \right )\right )}{6}-\frac {5 \left (\sec ^{3}\left (d x +c \right )\right )}{24}-\frac {5 \sec \left (d x +c \right )}{16}\right ) \tan \left (d x +c \right )+\frac {5 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(74\)
risch \(-\frac {i a \left (105 \,{\mathrm e}^{13 i \left (d x +c \right )}+700 \,{\mathrm e}^{11 i \left (d x +c \right )}+1981 \,{\mathrm e}^{9 i \left (d x +c \right )}-3072 \,{\mathrm e}^{7 i \left (d x +c \right )}-1981 \,{\mathrm e}^{5 i \left (d x +c \right )}-700 \,{\mathrm e}^{3 i \left (d x +c \right )}-105 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{168 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{7}}+\frac {5 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{16 d}-\frac {5 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{16 d}\) \(138\)

input
int(sec(d*x+c)^7*(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)
 
output
1/d*(1/7*I*a/cos(d*x+c)^7+a*(-(-1/6*sec(d*x+c)^5-5/24*sec(d*x+c)^3-5/16*se 
c(d*x+c))*tan(d*x+c)+5/16*ln(sec(d*x+c)+tan(d*x+c))))
 
3.1.11.5 Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 372 vs. \(2 (86) = 172\).

Time = 0.25 (sec) , antiderivative size = 372, normalized size of antiderivative = 3.80 \[ \int \sec ^7(c+d x) (a+i a \tan (c+d x)) \, dx=\frac {-210 i \, a e^{\left (13 i \, d x + 13 i \, c\right )} - 1400 i \, a e^{\left (11 i \, d x + 11 i \, c\right )} - 3962 i \, a e^{\left (9 i \, d x + 9 i \, c\right )} + 6144 i \, a e^{\left (7 i \, d x + 7 i \, c\right )} + 3962 i \, a e^{\left (5 i \, d x + 5 i \, c\right )} + 1400 i \, a e^{\left (3 i \, d x + 3 i \, c\right )} + 210 i \, a e^{\left (i \, d x + i \, c\right )} + 105 \, {\left (a e^{\left (14 i \, d x + 14 i \, c\right )} + 7 \, a e^{\left (12 i \, d x + 12 i \, c\right )} + 21 \, a e^{\left (10 i \, d x + 10 i \, c\right )} + 35 \, a e^{\left (8 i \, d x + 8 i \, c\right )} + 35 \, a e^{\left (6 i \, d x + 6 i \, c\right )} + 21 \, a e^{\left (4 i \, d x + 4 i \, c\right )} + 7 \, a e^{\left (2 i \, d x + 2 i \, c\right )} + a\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - 105 \, {\left (a e^{\left (14 i \, d x + 14 i \, c\right )} + 7 \, a e^{\left (12 i \, d x + 12 i \, c\right )} + 21 \, a e^{\left (10 i \, d x + 10 i \, c\right )} + 35 \, a e^{\left (8 i \, d x + 8 i \, c\right )} + 35 \, a e^{\left (6 i \, d x + 6 i \, c\right )} + 21 \, a e^{\left (4 i \, d x + 4 i \, c\right )} + 7 \, a e^{\left (2 i \, d x + 2 i \, c\right )} + a\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right )}{336 \, {\left (d e^{\left (14 i \, d x + 14 i \, c\right )} + 7 \, d e^{\left (12 i \, d x + 12 i \, c\right )} + 21 \, d e^{\left (10 i \, d x + 10 i \, c\right )} + 35 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 35 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 21 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 7 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]

input
integrate(sec(d*x+c)^7*(a+I*a*tan(d*x+c)),x, algorithm="fricas")
 
output
1/336*(-210*I*a*e^(13*I*d*x + 13*I*c) - 1400*I*a*e^(11*I*d*x + 11*I*c) - 3 
962*I*a*e^(9*I*d*x + 9*I*c) + 6144*I*a*e^(7*I*d*x + 7*I*c) + 3962*I*a*e^(5 
*I*d*x + 5*I*c) + 1400*I*a*e^(3*I*d*x + 3*I*c) + 210*I*a*e^(I*d*x + I*c) + 
 105*(a*e^(14*I*d*x + 14*I*c) + 7*a*e^(12*I*d*x + 12*I*c) + 21*a*e^(10*I*d 
*x + 10*I*c) + 35*a*e^(8*I*d*x + 8*I*c) + 35*a*e^(6*I*d*x + 6*I*c) + 21*a* 
e^(4*I*d*x + 4*I*c) + 7*a*e^(2*I*d*x + 2*I*c) + a)*log(e^(I*d*x + I*c) + I 
) - 105*(a*e^(14*I*d*x + 14*I*c) + 7*a*e^(12*I*d*x + 12*I*c) + 21*a*e^(10* 
I*d*x + 10*I*c) + 35*a*e^(8*I*d*x + 8*I*c) + 35*a*e^(6*I*d*x + 6*I*c) + 21 
*a*e^(4*I*d*x + 4*I*c) + 7*a*e^(2*I*d*x + 2*I*c) + a)*log(e^(I*d*x + I*c) 
- I))/(d*e^(14*I*d*x + 14*I*c) + 7*d*e^(12*I*d*x + 12*I*c) + 21*d*e^(10*I* 
d*x + 10*I*c) + 35*d*e^(8*I*d*x + 8*I*c) + 35*d*e^(6*I*d*x + 6*I*c) + 21*d 
*e^(4*I*d*x + 4*I*c) + 7*d*e^(2*I*d*x + 2*I*c) + d)
 
3.1.11.6 Sympy [F]

\[ \int \sec ^7(c+d x) (a+i a \tan (c+d x)) \, dx=i a \left (\int \left (- i \sec ^{7}{\left (c + d x \right )}\right )\, dx + \int \tan {\left (c + d x \right )} \sec ^{7}{\left (c + d x \right )}\, dx\right ) \]

input
integrate(sec(d*x+c)**7*(a+I*a*tan(d*x+c)),x)
 
output
I*a*(Integral(-I*sec(c + d*x)**7, x) + Integral(tan(c + d*x)*sec(c + d*x)* 
*7, x))
 
3.1.11.7 Maxima [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.08 \[ \int \sec ^7(c+d x) (a+i a \tan (c+d x)) \, dx=-\frac {7 \, a {\left (\frac {2 \, {\left (15 \, \sin \left (d x + c\right )^{5} - 40 \, \sin \left (d x + c\right )^{3} + 33 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1} - 15 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - \frac {96 i \, a}{\cos \left (d x + c\right )^{7}}}{672 \, d} \]

input
integrate(sec(d*x+c)^7*(a+I*a*tan(d*x+c)),x, algorithm="maxima")
 
output
-1/672*(7*a*(2*(15*sin(d*x + c)^5 - 40*sin(d*x + c)^3 + 33*sin(d*x + c))/( 
sin(d*x + c)^6 - 3*sin(d*x + c)^4 + 3*sin(d*x + c)^2 - 1) - 15*log(sin(d*x 
 + c) + 1) + 15*log(sin(d*x + c) - 1)) - 96*I*a/cos(d*x + c)^7)/d
 
3.1.11.8 Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 181 vs. \(2 (86) = 172\).

Time = 0.41 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.85 \[ \int \sec ^7(c+d x) (a+i a \tan (c+d x)) \, dx=\frac {105 \, a \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) - 105 \, a \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right ) + \frac {2 \, {\left (231 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{13} - 336 i \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{12} - 196 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 595 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 1680 i \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 595 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 1008 i \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 196 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 231 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 48 i \, a\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{7}}}{336 \, d} \]

input
integrate(sec(d*x+c)^7*(a+I*a*tan(d*x+c)),x, algorithm="giac")
 
output
1/336*(105*a*log(tan(1/2*d*x + 1/2*c) + 1) - 105*a*log(tan(1/2*d*x + 1/2*c 
) - 1) + 2*(231*a*tan(1/2*d*x + 1/2*c)^13 - 336*I*a*tan(1/2*d*x + 1/2*c)^1 
2 - 196*a*tan(1/2*d*x + 1/2*c)^11 + 595*a*tan(1/2*d*x + 1/2*c)^9 - 1680*I* 
a*tan(1/2*d*x + 1/2*c)^8 - 595*a*tan(1/2*d*x + 1/2*c)^5 - 1008*I*a*tan(1/2 
*d*x + 1/2*c)^4 + 196*a*tan(1/2*d*x + 1/2*c)^3 - 231*a*tan(1/2*d*x + 1/2*c 
) - 48*I*a)/(tan(1/2*d*x + 1/2*c)^2 - 1)^7)/d
 
3.1.11.9 Mupad [B] (verification not implemented)

Time = 8.36 (sec) , antiderivative size = 247, normalized size of antiderivative = 2.52 \[ \int \sec ^7(c+d x) (a+i a \tan (c+d x)) \, dx=\frac {5\,a\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{8\,d}-\frac {-\frac {11\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{13}}{8}+2{}\mathrm {i}\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+\frac {7\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}}{6}-\frac {85\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{24}+10{}\mathrm {i}\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+\frac {85\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{24}+6{}\mathrm {i}\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-\frac {7\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{6}+\frac {11\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8}+\frac {a\,2{}\mathrm {i}}{7}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}-7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+21\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-35\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+35\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-21\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]

input
int((a + a*tan(c + d*x)*1i)/cos(c + d*x)^7,x)
 
output
(5*a*atanh(tan(c/2 + (d*x)/2)))/(8*d) - ((a*2i)/7 + (11*a*tan(c/2 + (d*x)/ 
2))/8 - (7*a*tan(c/2 + (d*x)/2)^3)/6 + a*tan(c/2 + (d*x)/2)^4*6i + (85*a*t 
an(c/2 + (d*x)/2)^5)/24 + a*tan(c/2 + (d*x)/2)^8*10i - (85*a*tan(c/2 + (d* 
x)/2)^9)/24 + (7*a*tan(c/2 + (d*x)/2)^11)/6 + a*tan(c/2 + (d*x)/2)^12*2i - 
 (11*a*tan(c/2 + (d*x)/2)^13)/8)/(d*(7*tan(c/2 + (d*x)/2)^2 - 21*tan(c/2 + 
 (d*x)/2)^4 + 35*tan(c/2 + (d*x)/2)^6 - 35*tan(c/2 + (d*x)/2)^8 + 21*tan(c 
/2 + (d*x)/2)^10 - 7*tan(c/2 + (d*x)/2)^12 + tan(c/2 + (d*x)/2)^14 - 1))